Add test case for project root located in dotdir
authorPhilipp Gesang <phg@phi-gamma.net>
Fri, 2 Oct 2015 22:19:39 +0000 (00:19 +0200)
committerPhilipp Gesang <phg@phi-gamma.net>
Fri, 2 Oct 2015 22:26:08 +0000 (00:26 +0200)
tests/test_cargo_compile.rs

index cd1714c1876df2c903bec4b61df3fb79a09284af..ebef666bf34759d1339807f10da7d45992bd887a 100644 (file)
@@ -7,7 +7,7 @@ use tempdir::TempDir;
 use support::{project, execs, main_file, basic_bin_manifest};
 use support::{COMPILING, RUNNING, ProjectBuilder};
 use hamcrest::{assert_that, existing_file, is_not};
-use support::paths::CargoPathExt;
+use support::paths::{CargoPathExt,root};
 use cargo::util::process;
 
 fn setup() {
@@ -1868,6 +1868,20 @@ test!(ignore_dotdirs {
                 execs().with_status(0));
 });
 
+test!(dotdir_root {
+    let p = ProjectBuilder::new("foo", root().join(".foo"))
+        .file("Cargo.toml", r#"
+            [package]
+            name = "foo"
+            version = "0.0.1"
+            authors = []
+        "#)
+        .file("src/bin/a.rs", "fn main() {}");
+    p.build();
+    assert_that(p.cargo("build"),
+                execs().with_status(0));
+});
+
 
 test!(custom_target_dir {
     let p = project("foo")